import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/index',
    children:[
      {
        path: '/index',
        component: () => import('../views/Index.vue'),
       
      },
      {
        path: '/topic',
        component: () => import('../views/topic.vue'),
       
      }
      ]
  },
  {
    path: '/404',
    component: () => import('../views/404.vue'),
  },
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
